import 'package:flutter/material.dart';
import '../../share/my_assets_image.dart';
import '../../share/my_color.dart';
import '../../share/my_font.dart';

class ShowSearchWidget extends StatelessWidget {
  final Function? function;
  final String? placeholder;

  ShowSearchWidget({this.function, this.placeholder});

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        if (this.function != null) this.function!();
      },
      child: Container(
        height: 32,
        width: double.infinity,
        margin: EdgeInsets.symmetric(vertical: 5, horizontal: 20),
        padding: EdgeInsets.symmetric(vertical: 5, horizontal: 13),
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(16),
          color: MyColors.formHex("#F4F4F4FF"),
        ),
        child: Row(
          children: [
            Image.asset(
              MyAssetsImages.setAssetsImagesPath("ic_search_h.png"),
              width: 15,
              height: 15,
            ),
            SizedBox(width: 5),
            Text(
              this.placeholder!,
              style: TextStyle(
                color: MyColors.formHex("#CCCCCCFF"),
                fontSize: MyFont.font12,
                fontWeight: FontWeight.w500,
              ),
            )
          ],
        ),
      ),
    );
  }
}
